<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<!--
			数组为[1,3,5,7,24,32,25,48]
			1.求数组奇数和偶数的个数
			2.求数组的平均值
			
		-->
		<script type="text/javascript">
			var arr = [1,3,5,7,24,32,25,48]
			var a=0
			var b=0
			for (var i=0,len=arr.length;i<len;i++) {
				if (arr[i]%2==0) {
					//偶数
					a++
				}else{
					//奇数
					b++
				}
			}
			console.log("偶数个数：",a)
			console.log("奇数个数：",b)
			var sum =0
			for (var i=0,len=arr.length;i<len;i++) {
				sum = sum +arr[i]
			}
			var c = sum/arr.length
			console.log("数组的平均值：",c)
		</script>
	</body>
</html>
